home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / RIncludes / OCE.r < prev    next >
Encoding:
Text File  |  1995-06-08  |  13.4 KB  |  449 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Tuesday, August 17, 1993 4:37:24 PM
  4.  OCE.r
  5.  Types definitions for Rez and DeRez.
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1993
  8.   All rights reserved
  9.  
  10. ************************************************************/
  11.  
  12.  
  13. #ifndef __OCE_R__
  14. #define __OCE_R__
  15.  
  16. #ifndef __OCE__
  17. #include "OCE.h"
  18. #endif
  19. #ifndef __OCETEMPLATES__
  20. #include "OCETemplates.h"
  21. #endif
  22.  
  23.  
  24. /**********************************************************************************************/
  25. /********************************* Template Resource Formats: *********************************/
  26. /**********************************************************************************************/
  27.  
  28. /* OCE template file type: 'detf' */
  29.  
  30.  
  31. /* ************************************ RString */
  32.  
  33. #define rstring integer = 0; wstring
  34.  
  35. type 'rstr' {
  36.     rstring;    /* an RString */
  37. };
  38.  
  39.  
  40. /* ************************************ RString List */
  41.  
  42. type 'rst#' {
  43.     integer = (endOfData - startOfData) / 8;
  44. startOfData:
  45.     integer = $$CountOf(RStrArray);     /* Array size */
  46.     array RStrArray {
  47.         rstring;
  48.         align word;
  49.     };
  50. endOfData:
  51. };
  52.  
  53.  
  54. /* ************************************ Number */
  55.  
  56. type 'detn' {
  57.     longInt;
  58. };
  59.  
  60.  
  61. /* ************************************ Aspect Template */
  62.  
  63. type 'deta' {
  64.     longInt = kDETInfoPageVersion;                    /* Template format version */
  65.     longInt;                                        /* Drop operation priority (ordering for drop operation with multiple possible) */
  66.     boolean dropCheckConflicts, dropCheckAlways;    /* Whether to check with the user if we're the only valid drop destination */
  67.     boolean notMainAspect, isMainAspect;            /* Whether this is a main aspect for this type */
  68.     align word;                                        /* Future expansion */
  69. };
  70.  
  71.  
  72. /* ************************************ Custom Window Definition (should not be used for normal info-pages) */
  73. type 'detw' {
  74.     rect;                                    /* Info-page window;
  75.                                                 top == 0 for standard placement;
  76.                                                 top == -1 for center on screen;
  77.                                                 otherwise absolute position */
  78.     boolean discludePopup, includePopup;    /* Whether to include a page-selection pop-up */
  79.     align word;                                /* Future expansion */
  80. };
  81.  
  82.  
  83. /* ************************************ Attribute Pattern Table */
  84.  
  85. type 'dett' {
  86.     integer = $$CountOf(AttributeArray);        /* Attribute array size */
  87.     array AttributeArray {
  88.         integer = $$CountOf(TypeArray);            /* Attribute type array size */
  89.         array TypeArray {
  90.             rstring[32];                        /* Attribute type */
  91.         };
  92.         longInt;                                /* Attribute tag */
  93.         boolean notForInput, useForInput;        /* Whether to use this pattern for input processing */
  94.         boolean notForOutput, useForOutput;        /* Whether to use this pattern for output processing */
  95.         boolean notInSublist, useInSublist;        /* Whether to include this attribute type in the sublist */
  96.         boolean isNotAlias, isAlias;            /* Whether to mark this attribute value as an alias */
  97.         boolean isNotRecordRef, isRecordRef;    /* Whether to mark this attribute value as a record reference */
  98.         align word;                                /* Future expansion */
  99.         integer = $$CountOf(PatternArray);        /* Pattern array size */
  100.         array PatternArray {
  101.             longint;                            /* Pattern element type */
  102.             integer;                            /* Property number */
  103.             integer;                            /* Extra (sometimes property #, sometimes resource ID, sometimes...) */
  104.         };
  105.     };
  106. };
  107.  
  108. /* Pattern element types (pattern elements consist of a <type>, a <property>, and an <extra>):
  109.  
  110.         Element Type    Property Type    Format
  111.         ------------    -------------    ------
  112.            '(((('           Binary        Everything specified by the elements up to a '))))'
  113.            '))))'           None            Ends a '((((' block
  114.  
  115.            'byte'           Number        One byte
  116.            'word'           Number        Two bytes
  117.            'long'           Number        Four bytes
  118.            'bbit'           Number        One bit
  119.            'blok'           Binary        <Extra> field is a size; a block <extra> bytes in size
  120.            'rest'           Binary        The rest of the attribute
  121.  
  122.            'bsiz'           Binary        Binary field starting with byte-size length (property doesn't include length)
  123.            'wsiz'           Binary        Binary field starting with word-size length (property doesn't include length)
  124.            'lsiz'           Binary        Binary field starting with long-size length (property doesn't include length)
  125.  
  126.            'rstr'           RString        An RString (two byte script, two byte length, data)
  127.            'pstr'           RString        A Pascal string (length byte, data)
  128.            'wstr'           RString        A word length followed by the string data bytes
  129.            'cstr'           RString        A C string (null byte terminated)
  130.  
  131.            'type'           RString        A four-character type (long can also be used if you want it as a number)
  132.  
  133.            'abyt'           None            Align to next even byte in attribute
  134.            'awrd'           None            Align to next even word in attribute
  135.            'alng'           None            Align to next even long in attribute
  136.  
  137.            'padz'           None            <Extra> field is a size; process the next pattern element; then zero-fill so
  138.                                         that the total length is the size specified by <extra>
  139.  
  140.            'p:=p'           None            Set one property from another (extra field is the source property)
  141.  
  142.            'equa'           None            If property <property> == property <extra> process next element; otherwise skip it
  143.            'nteq'           None            If property <property> != property <extra> process next element; otherwise skip it
  144.            'less'           None            If property <property> <  property <extra> process next element; otherwise skip it
  145.            'grea'           None            If property <property> >  property <extra> process next element; otherwise skip it
  146.            'leeq'           None            If property <property> <= property <extra> process next element; otherwise skip it
  147.            'greq'           None            If property <property> >= property <extra> process next element; otherwise skip it
  148.  
  149.            'abrt'           None            Abort pattern processing
  150.  
  151.            'prop'           Any            Declare a property number that this pattern works with; this allows template-specified
  152.                                         pattern elements which reference property numbers other than those in the property field
  153.  
  154.            'btyp'           None            <Extra> contains a property type, which is used on all subsequent block elements
  155.                                         ('((((', 'blok', 'rest', 'bsiz', 'wsiz', 'lsiz')
  156.            'styp'           Any            Set the type of the specified <property> to type <extra>
  157.  
  158.     Any pattern element types starting with upper-case letters are passed on to the template code resource. */
  159.  
  160.  
  161. /* ************************************ Info-page Template */
  162.  
  163. type 'deti' {
  164.     longInt = kDETInfoPageVersion;                /* Template format version */
  165.     longInt;                                    /* Sort order */
  166.     rect;                                        /* Rectangle to put sublist in */
  167.     boolean selectFirstText, noSelectFirstText;    /* Whether to select the first text field when info-page opens */
  168.     align word;                                    /* Future expansion */
  169.     integer = $$CountOf(HeaderViewArray);
  170.     array HeaderViewArray {                        /* The header view lists */
  171.         integer;                                    /* Property 1 */
  172.         integer;                                    /* Property 2 */
  173.         integer;                                    /* 'detv' ID */
  174.     };
  175.     integer = $$CountOf(SubviewViewArray);
  176.     array SubviewViewArray {                    /* The subview view lists */
  177.         integer;                                    /* Property 1 */
  178.         integer;                                    /* Property 2 */
  179.         integer;                                    /* 'detv' ID */
  180.     };
  181. };
  182.  
  183.  
  184. /* ************************************ View */
  185.  
  186. type 'detv' {
  187.     /* this will all be taken out in a later revision (probably): */
  188.     longint = 0;
  189.     longint = 0;
  190.     longint = 0;
  191.     integer = 0;
  192.     longint = 0;
  193.     longint = 0;
  194.     longint = 0;
  195.     longint = 0;
  196.     integer = 0;
  197.     longint = 0;
  198.     longint = 0;
  199.  
  200.     integer = $$CountOf(ItemArray);                /* count */
  201.     array ItemArray {
  202.         rect;                                    /* bounds */
  203.         longint = 0;                            /* position    flags (autoset by DE) */
  204.         longint;                                /* flags */
  205.         integer;                                /* property (prName, prKind, etc…) */
  206.         switch {                                /* class */
  207.             case StaticTextFromView:
  208.                 key longint = 7750;
  209.                 integer;                        /* font */
  210.                 integer;                        /* fontSize */
  211.                 integer;                        /* justification */
  212.                 integer;                        /* style */
  213.                 pstring;                        /* title */
  214.  
  215.             case StaticCommandTextFromView:
  216.                 key longint = 22250;
  217.                 integer;                        /* font */
  218.                 integer;                        /* fontSize */
  219.                 integer;                        /* justification */
  220.                 integer;                        /* style */
  221.                 pstring;                        /* title */
  222.                 align word;                        /* align it */
  223.                 longint;                        /* command */
  224.                 integer;                        /* value */
  225.  
  226.             case StaticText:
  227.                 key longint = 3250;                /* class id */
  228.                 integer;                        /* font */
  229.                 integer;                        /* fontSize */
  230.                 integer;                        /* justification */
  231.                 integer;                        /* style */
  232.  
  233.             case EditText:
  234.                 key longint = 8250;                /* class id */
  235.                 integer;                        /* font */
  236.                 integer;                        /* fontSize */
  237.                 integer;                        /* justification */
  238.                 integer;                        /* style */
  239.  
  240.             case Bitmap:
  241.                 key longint = 6250;
  242.                 integer;                        /* size */
  243.  
  244.             case Box:
  245.                 key longint = 4750;
  246.                 integer;                        /* box attributes */
  247.  
  248.             case DefaultButton:
  249.                 key longint = 7250;
  250.                 integer;                        /* font */
  251.                 integer;                        /* fontSize */
  252.                 integer;                        /* justification */
  253.                 integer;                        /* style */
  254.                 pstring;                        /* title */
  255.                 align word;                        /* align it */
  256.                 longint;                        /* command */
  257.  
  258.             case Button:
  259.                 key longint = 21000;
  260.                 integer;                        /* font */
  261.                 integer;                        /* fontSize */
  262.                 integer;                        /* justification */
  263.                 integer;                        /* style */
  264.                 pstring;                        /* title */
  265.                 align word;                        /* align it */
  266.                 longint;                        /* command */
  267.  
  268.             case CheckBox:
  269.                 key longint = 21250;
  270.                 integer;                        /* font */
  271.                 integer;                        /* fontSize */
  272.                 integer;                        /* justification */
  273.                 integer;                        /* style */
  274.                 pstring;                        /* title */
  275.                 align word;                        /* align it */
  276.                 longint;                        /* command */
  277.  
  278.             case RadioButton:
  279.                 key longint = 21500;
  280.                 integer;                        /* font */
  281.                 integer;                        /* fontSize */
  282.                 integer;                        /* justification */
  283.                 integer;                        /* style */
  284.                 pstring;                        /* title */
  285.                 align word;                        /* align it */
  286.                 longint;                        /* command */
  287.                 integer;                        /* value */
  288.  
  289.             case Menu:
  290.                 key longint = 5750;
  291.                 integer;                        /* font */
  292.                 integer;                        /* fontSize */
  293.                 integer;                        /* justification */
  294.                 integer;                        /* style */
  295.                 pstring;                        /* title */
  296.                 align word;                        /* align it */
  297.                 longint;                        /* command */
  298.                 integer;                        /* menu ResID */
  299.  
  300.             case EditPicture:
  301.                 key longint = 0x00010000+24250;
  302.                 integer;                        // maximum pixel depth
  303.  
  304.             case Custom:
  305.                 key longint = 6750;
  306.                 integer;                        /* user reference */
  307.         };
  308.         align word;
  309.     };
  310. };
  311.  
  312.  
  313. /* ************************************ Menu */
  314.  
  315. type 'fmnu' {
  316.     integer = false;                    /* Auto-initialize flag */
  317.     integer = $$CountOf(ItemArray)+1;    /* Number of items */
  318.  
  319.     /* The following is the first item in the array, which is preset. */
  320.     longint;                            /* Resource id of this resource */
  321.     integer = (1 << 0)+(1 << 7);        /* Item flags */
  322.     string[1] = "";                        /* Key equivalent */
  323.     align word;
  324.     pstring = "";                        /* Menu title */
  325.     align word;
  326.  
  327.     /* The menu item array: */
  328.     array ItemArray {
  329.         longint;                        /* Command ID */
  330.         integer = (1 << 0)+(1 << 13)+(1 << 15); /* Item flags */
  331.         string[1] = "";                    /* Key equivalent (not allowed for templates) */
  332.         align word;
  333.         pstring;                        /* Menu title */
  334.         align word;
  335.     };
  336. };
  337.  
  338. /* ************************************ Custom Menu */
  339.  
  340. type 'detm' as 'fmnu';
  341.  
  342.  
  343. /* ************************************ Property Table */
  344.  
  345. type 'detp' {
  346.     integer = $$CountOf(SortArray);        /* Number of items */
  347.     array SortArray {
  348.         integer;                        /* Property number */
  349.     };
  350. };
  351.  
  352.  
  353. /* ************************************ Killer Template */
  354.  
  355. type 'detk' {
  356.     longInt = kDETKillerVersion;        /* Template format version */
  357. };
  358.  
  359.  
  360. /* ************************************ Forwarder Template */
  361.  
  362. type 'detf' {
  363.     longInt = kDETForwarderVersion;        /* Template format version */
  364. };
  365.  
  366.  
  367. /* ************************************ File Type Template */
  368.  
  369. type 'detx' {
  370.     longInt = kDETFileTypeVersion;        /* Template format version */
  371.     integer = $$CountOf(ItemArray);        /* Count */
  372.     array ItemArray {
  373.         longInt;                        /* Type of additional file */
  374.     };
  375. };
  376.  
  377.  
  378. /*************************************************************************************************/
  379. /********************************* Collab Pack Resource Formats: *********************************/
  380. /*************************************************************************************************/
  381.  
  382. /* ************************************ Panel */
  383.  
  384. type 'panl' {
  385.     rect;                                                    /* Bounds                */
  386.     byte            invisible, visible;                     /* visible                */
  387.     byte            disabled, enabled;                        /* enabled                */
  388.     longint;                                                /* Enum Flags            */
  389.     integer;                                                /* MatchTypeHow            */
  390.     longint;                                                /* RefCon                */
  391.     integer = $$CountOf(TypeIdArray);                        /* Nbr of types            */
  392.     array TypeIdArray {
  393.        integer;                                              /* 'rtyp' resource id for a type */
  394.     };
  395. };
  396.  
  397. /* Values for MatchTypeHow: */
  398. #define kMatchAll    0
  399. #define kExactMatch    1
  400. #define kBeginsWith    2
  401. #define kEndsWith    3
  402. #define kContains    4
  403.  
  404.  
  405. /* ************************************ Find */
  406.  
  407. type 'find' {
  408.     pstring;                /* "Find" text */
  409.     align word;
  410.     pstring;                /* "Search" text */
  411.     align word;
  412.  
  413.     array [5] {
  414.         integer        sysFont, appFont, portFont;
  415.         integer;                /* face */
  416.         integer;                /* size */
  417.         rect;                    /* bounds */
  418.     };
  419.  
  420. };
  421.  
  422.  
  423. /* ************************************ SAM */
  424.  
  425. type 'sami' {
  426.     integer;                                /* Max number of catalogs/slots */
  427.     longint;                                /* catalog signature, MSAM type */
  428.     byte notMSAM, servesMSAM;                /* An MSAM template? */
  429.     byte notDSAM, servesDSAM;                /* A CSAM template? */
  430.     rstring;                                /* Displayed to user when user clicks the Add… button */
  431.     align word;
  432.     rstring;                                /* New Record Name */
  433.     align word;
  434. };
  435.  
  436.  
  437. /* ************************************ Admin */
  438.  
  439. /* Goes in 'deta' and 'deti' templates, at base ID */
  440.  
  441. type 'admn' {
  442.     integer = kDETAdminVersion;                /* version */
  443.     longint = 0;                            /* reserved */
  444.     longint = 0;                            /* reserved */
  445. };
  446.  
  447.  
  448. #endif
  449.